{layout "@projectLayout.latte"}
{block content}
<div id="block_bg">
	<div id="block_left">
		<h1 class="block projectname">{$project['name']} > Úkoly</h1>
		<div class="block">
		{snippet tasks}
			<table class="project_tasks">
				<tr>
					<th><a href="{link orderBy!, 'priority'}">.</a></th>
					<th><a href="{link orderBy!, 'name'}" class="ajax">Název</a></th>
					<th><a href="{link orderBy!, 'worker'}" class="ajax">Realizátor</a></th>
					<th><a href="{link orderBy!, 'deadline'}" class="ajax">Deadline</a></th>
					<th><a href="{link orderBy!, 'completed'}" class="ajax">Dokončeno</a></th>
					<th></th>
				</tr>
			{foreach $tasks as $task}
				<tr class="project_tasks_task_line{if $task[worker_id]==$user->id && $task[userpriority]!==null} priority{$task[userpriority]}{/if}" data-id="{$task[id]}" data-status="{$task[task_status_id]}" data-completed="{$task[completed]}" data-creator="{= (int)($user->id == $task[creator_id])}" data-worker="{= (int)($user->id == $task[worker_id])}">
					<td class="project_tasks_priority priority{$task->task_priority[priority]}" title="{$task->task_priority[name]}"></td>
					<td class="project_tasks_task_name">{$task[name]}</td>
					<td class="project_tasks_worker">{$task->worker[name]} {$task->worker[surname]}</td>
					<td class="project_tasks_deadline"{if $task[deadline] > 0 && $task->task_status[completed] == 'no'} title="{$task[deadline]|date:$dateFormatLong}">{!$task[deadline]|remaining_days}{else}>{/if}</td>
					<td class="project_tasks_completed"><div class="project_tasks_completed_graph"><div class="project_tasks_completed_bar" style="width: {$task[completed]}%"></div><div class="project_tasks_completed_text">{$task[completed]}%</div></div></td>
					<td class="project_tasks_actions"><a href="{link Task:task $task[id]}"><img src="{$basePath}/images/info.png" alt="I"></a> <a href="javascript:void(0)" class="menuImage"><img src="{$basePath}/images/action.png" alt="A"></a></td>
				</tr>
			{/foreach}
			</table>
		{/snippet}
			<div id="explanation">
				<div id="exp_priorities">{foreach $priorities as $priority}<div class="exp_priority priority{$priority[priority]}"></div> {$priority[name]} {/foreach}</div>
			</div>
		</div>
	</div>
	<div id="block_right">
	{include "rightPanel.latte"}
	</div>
	<div class="clear"></div>
</div>
{include #contextMenu, 'menuItemCssClass'=>'.project_tasks_task_line'}
{/block}
